import { SPetArenaAccumulateRewardInfo } from "../../../../../Message/Game/SPetArenaAccumulateRewardInfo";
import { Language } from "../../../../../extend/language/Language";
import { PetCpnRewardUtil } from "./info/PetCpnRewardUtil";
import { ObjCreate } from "../../common/ObjCreate";
import { Dispatcher } from "../../../../mvc/core/Dispatcher";
import { DataEvent } from "../../../events/DataEvent";
import { EventName } from "../../../mvc/EventName";
import { EPetArenaReward } from "../../../../../Message/Game/EPetArenaReward";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
import { GButton } from "../../../../../com/mui/controls/GButton";
import { _EPetArenaRewardAccumulate } from "../../../../../EPetArenaReward/_EPetArenaRewardAccumulate";
//class PetCpnGetRewardTipPanel
    
    export  class PetCpnGetRewardTipPanel /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.init();
            return;
        }

        public update(arg1: SPetArenaAccumulateRewardInfo): void
        {
            this._tipTxt.htmlText = Language.getStringByParam(54803, PetCpnRewardUtil.getStrByRewardArray(arg1.rewards));
            return;
        }

        /* internal  */init(): void
        {
            this._tipTxt = ObjCreate.createGTextField("", 0, 0, 190, 20, this);
            this._tipTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._tipTxt.wordWrap = true;
            this._getBtn = ObjCreate.createGButton(Language.getString(54804), 120, 50, 70, 28, this);
            this._getBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onGetBtnClickHandler);
            return;
        }

        /* internal  */onGetBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.PetCpnGetReward, {"type": _EPetArenaRewardAccumulate}));
            Dispatcher.dispatchEvent(new DataEvent(EventName.MsgTipWindowHide));
            return;
        }

        /* internal */ /* var */_tipTxt: GTextFiled;

        /* internal */ /* var */_getBtn: GButton;
    }
